<template>
  <div class="bgc">

    <van-grid :column-num="2">
      <van-grid-item
        v-for="(item, index) in this.tiku_res"
        :key="index"
        @click="
          $router.push({
            path: '/homeworkCate',
            query: {
              id: item.id,
            },
          })
        "
      >   
        <template slot="icon">
          <img        
            class="tiku_img"
            :src="'http://video.zjsxjy.com/' + item.icon"
            alt=""
          />
        </template>
        <template slot="text"> {{ item.title }}</template>
      </van-grid-item>
    </van-grid>

  </div>
</template>

<script>
import { getCorseList } from '../../api/index'
export default {
  data() {
    return {
      tiku_res: null,
    }
  },
  created() {
    this.getList1()
  },
  methods: {
    async getList1() {
      console.log(123)
      try {
        const { data: res } = await getCorseList()
        console.log(res.data, res, 'id')
        this.tiku_res = res.data
      } catch (err) {
        console.log(err)
      }
    },
  },
}
</script>
<style lang="scss" scoped>
.tiku_img {
  width: 87px;
  height: 87px;
}
.van-grid-item{
 padding: 10px;
}
.bgc{
  height: 100vh;
  background-color:#efeff4 ;
}
</style>
